Business Rules
Several areas of the product use the same rule syntax and control how data is imported, how cubes are calculated, and how other operations are performed. When this syntax is understood, logic can be written.
See the API Overview Guide.
Ways to Write Calculation Logic
There are multiple ways to write calculation logic in OneStream:
Business Rules
Business rules are found under Application Tab > Tools. There are nine types of business rules. These rules can be stored, secured, and assigned to multiple areas of the product, allowing them to be reused.
Complex Expression
Logic can be written as a business rule or as a complex expression within an application artifact, such as a data source. The syntax is the same. The difference is that a business rule can be shared across multiple application artifacts, whereas a complex expression is contained within the artifact.
Member Formula
The same business rule syntax can be applied to Member Formulas. This logic is stored with the member and cannot be shared.
Business Rule Utility Groups
Different utility groups are available when writing business rules:
BRApi
BRApi provides application programming interface to commonly used functions involving all areas of the product where a business rule can be used.
API
The more specific API provided as a parameter to a business rule supplies functions specific to the type of business rule being written. For example, when implementing a business rule for a finance-oriented task, the API refers to the functions used for processing calculation logic and other capabilities related to processing a cube data and metadata.
ARGS
An argument represents a value passed to a business rule when the procedure is called and the calling code supplies the arguments. For example, if a Parser business rule is assigned to the Account dimension, args supplies the Account dimension data and a set of functions available to use against that data. Different args are provided depending on the type of business rule used.
Business Rule Encryption and Decryption
Business rules can be encrypted and decrypted with password protection to prevent unauthorized access. Authorized users can encrypt a business rule by selecting the Encrypt Business Rule button.
IMPORTANT: Save the password used for each encrypted business rule. If the password is lost, the business rule cannot be decrypted for further changes without OneStream Support.
To decrypt a business rule, an authorized user selects the Decrypt Business Rule button. The Decrypt Business Rule dialog box displays, prompting the user for a password. The user enters the password and selects the OK button. The system decrypts the business rule, displays the Business Rule text editor, and returns the to editor mode to read/write.
Set the proper access to the EncryptBusinessRules security role to allow an authorized user to encrypt and decrypt a rule from the Business Rule screen in the Application tab.
Encrypt a Business Rule
-
Go to Application tab > Tools > Business Rules.
-
Refresh the screen. The Encrypt Business Rule button displays in the menu.
-
Select the business rule to encrypt.
-
Select the Encrypt Business Rule button.
-
In the Encrypt Business Rule dialog box, enter a password.
-
Reenter the password and select the OK button.
The system encrypts the Business Rule, displays the Business Rule Is Encrypted message in the editor, and updates the editor to read-only mode. The Decrypt Business Rule button is now displayed in the menu bar.
Decrypt a Business Rule
-
Select the encrypted business rule.
-
Select the Decrypt Business Rule button.
-
Enter the password and select the OK button.
The system decrypts the businessrRule, displays the Business Rule text editor, and returns the editor to read/write mode.
Business Rule Search
Find a business rule quickly by performing a search instead of scrolling through the list.
-
Select the Application tab.
-
From Tools, select Business Rules.
-
Select the Business Rule Search icon. The Object Lookup dialog box opens.
-
Enter the start of the business rule name. All business rules that match display in the list.
-
Select the business rule from the list, then select the OK button.
Business Rule Toolbar and Hot Keys
Compile Business Rule to Check Syntax
Compile a selected business rule to check its syntax.
Compile All Business Rules and Formulas to Check Syntax
Compile all business rules and formulas to check the syntax. This is most commonly used after installing a software upgrade where some rule or formula syntax may have changed. This feature is available only to application administrators.
Execute Extender
Runs the selected Extender business rule
Encrypt Business Rule
Encrypt the business rule formula by selecting this button to prompt the user to enter a password in the Encrypt Business Rule dialog box to complete the encryption process.
Decrypt Business Rule
Decrypt the business rule formula by selecting this button to prompt the user to enter a password in the Decrypt Business Rule dialog box to complete the decryption process.
Ctrl + M
Expand or collapse all regions and methods. After selecting the business rule, click in the script to use the hot key.
Business Rule Client Image Types
Client images are specified uisng the XFClientImageType Class in a business rule. These images can display on certain Dashboard Parameter components, for example, Buttons, Maps, SQL Table Editors, and Grid Views.
These are the Image types:
-
StatusGrayBall
-
StatusWhiteBall
-
StatusOrangeBall
-
StatusBlueBall
-
StatusRedBall
-
StatusLightGreenBall
-
StatusGreenBall
-
StatusGrayCheckMark
-
StatusGreenCheckMark
-
StatusLockedWithCheckMark
-
StatusLockedWithFolder